package main

import (
	"fmt"
)

func main() {
	s := new(string)
	i := new(int)
	sl := new([]int)
	fmt.Println(s)
	fmt.Println(i)
	fmt.Println(sl)

}

func f(x int) (int, error) {

	return x, nil
}
func m(lis []int, f func(x int) (int, error)) ([]int, error) {

	res := make([]int, 0)
	errCh := make(chan error)
	doneCh := make(chan struct{})
	for k, v := range lis {
		go func(k, v int) {
			r, err := f(v)
			if err != nil {
				errCh <- err
			}
			res[k] = r
			doneCh <- struct{}{}
		}(k, v)
	}
	select {
	case err1 := <-errCh:
		return nil, err1
	case <-doneCh:
	}
	return res, nil
}
